import SocketController from "../controller/Socket.Controller";
import Router from 'koa-router'
import DeviceController from "../controller/Admin/Device.Controller"

let router = new Router({prefix:"/socket"})


// 设备通信保证是唯一
router.get('/health',(ctx: any) => {
    ctx.body = {
        code: 200,
        msg: "心跳检测成功"
    }
})

router.get("/getSerialport",SocketController.getSerialPort)

router.post("/changeSerialport",SocketController.changeSerialPort)

// 以下路由暂时注释掉，因为DeviceController文件不存在
router.get('/getSortPoint',DeviceController.getSortPoint) // 获取监测点报警统计

router.get('/getGatewayList',DeviceController.getGatewayList) // 获取网关列表

router.get('/getModuleNum',DeviceController.getModuleNum)

export default router